<template>
	<view>
		<view v-for="item,index in listData" :key="index"
			:class="listData&&index!=listData.length-1?'itemBox underline':'itemBox'">
			<commonText name="客户名称" :value="item.key1" />
			<commonText name="款式名称" :value="item.key2" />
			<view v-for="divItme,divIndex in getDiyList(item)">
				<commonText :name="divItme.name" :value="divItme.value" v-if="divItme.type == 'text'" />
				<commonImage :name="divItme.name" :value="divItme.value" v-if="divItme.type == 'img'" />
			</view>
			<listItemTool  :item="item" code="addBus" @success="success" />
		</view>
	</view>
</template>

<script>
	import commonText from "./commonText"
	import commonImage from "./commonImage"
	import listItemTool from "./listItemTool"
	export default {
		name: "busList",
		props: {
			listData: {
				default: []
			},
			keyWord:{
				default:'',
				type:String
			}
		},
		computed: {

		},
		components: {
			commonText,
			commonImage,
			listItemTool
		},
		data() {
			return {};
		},
		methods: {
			getDiyList(item) {
				if (item.key1Ext) {
					return JSON.parse(item.key1Ext)
				}
				return []
			},
			click() {
				this.$emit("onPress")
			},
			success(){
				this.$emit("reload")
			}
		}
	}
</script>

<style lang="scss" scoped>
	.itemBox {
		width: 100%;
	}

	.underline {
		border-bottom: solid 1rpx rgb(244, 243, 244);
	}
</style>
